# 按名称加载
from langfuse import Langfuse
# 加载 .env 到环境变量
from dotenv import load_dotenv, find_dotenv

_ = load_dotenv(find_dotenv())
langfuse = Langfuse()
#prompt = langfuse.get_prompt("prompt-1")

# 按名称和版本号加载
prompt = langfuse.get_prompt("prompt-1", version=3)

# 对模板中的变量赋值
compiled_prompt = prompt.compile(user_name="张三")

print(compiled_prompt)
# 获取 config

prompt = langfuse.get_prompt("need_answer_v1", version=5)

print(prompt.config)
